# Disponivel no pacote de programas como: graphplots.py
import networkx as NX
import pylab as P

g=NX.Graph()
g.add_path([1,2,3,4])
pc=NX.cartesian_product(g,g)
c = NX.complement(pc)

P.subplot(131)
NX.draw(g)
P.title('Grafo G')
P.subplot(132)
NX.draw(pc)
P.title('Produto cartesiano GxG')
P.subplot(133)
NX.draw(c)
P.title('Complemento de GxG')
P.savefig('grafo-pc-comp.png',dpi=400)
P.show()
